Aspect-based sentiment analysis based on pre-trained models generally uses end-to-end frameworks, has the problems of inconsistency between the upstream and downstream tasks, and is difficult to model the relationships between aspect words and context effectively. To address these problems, an aspect-based sentiment analysis method integrating prompt knowledge was proposed. First, in order to capture the semantic relation between aspect words and context effectively and enhance the model’s perception ability for sentiment analysis tasks, based on the Prompt mechanism, a prompt text was constructed and spliced with the original sentence and aspect words, and the obtained results were used as the input of the pre-trained model Bidirectional Encoder Representations from Transformers (BERT). Then, a sentimental label vocabulary was built and integrated into the sentimental verbalizer layer, so as to reduce search space of the model, make the pre-trained model obtain rich semantic knowledge in the label vocabulary, and improve the learning ability of the model. Experimental results on Restaurant and Laptop field datasets of SemEval2014 Task4 dataset as well as ChnSentiCorp dataset show that the F1-score of the proposed method reaches 77.42%, 75.20% and 94.89% respectively, which is increased by 0.65 to 10.71, 1.02 to 9.58 and 0.83 to 6.40 percentage points compared with the mainstream aspect-based sentiment analysis methods such as Glove-TextCNN and P-tuning. The above verifies the effectiveness of the proposed method.